﻿using System;
using System.Runtime.Serialization;

namespace OnlineGameLibrary.Contract
{
    [DataContract(Namespace = "http://gameservice")]
    public class OperationResult
    {
        [DataMember]
        public bool IsSuccess { set; get; }
        [DataMember]
        public string ResultMessage { set; get; }

        static public OperationResult Success()
        {
            return new OperationResult
            {
                IsSuccess = true
            };
        }

        static public OperationResult Failed(string reason)
        {
            return new OperationResult
            {
                IsSuccess = false,
                ResultMessage = reason
            };
        }
    }
}
